package com.gigalaxy.game.protocol.zone {
	import com.netease.protobuf.*;
	import com.netease.protobuf.fieldDescriptors.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public dynamic final class RoomGroupData extends com.netease.protobuf.Message {
		public static const GROUPID:FieldDescriptor$TYPE_STRING = new FieldDescriptor$TYPE_STRING("com.gigalaxy.game.protocol.zone.RoomGroupData.groupId", "groupId", (1 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		private var groupId$field:String;

		public function clearGroupId():void {
			groupId$field = null;
		}

		public function get hasGroupId():Boolean {
			return groupId$field != null;
		}

		public function set groupId(value:String):void {
			groupId$field = value;
		}

		public function get groupId():String {
			return groupId$field;
		}

		public static const DISPLAYNAME:FieldDescriptor$TYPE_STRING = new FieldDescriptor$TYPE_STRING("com.gigalaxy.game.protocol.zone.RoomGroupData.displayName", "displayName", (2 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		private var displayName$field:String;

		public function clearDisplayName():void {
			displayName$field = null;
		}

		public function get hasDisplayName():Boolean {
			return displayName$field != null;
		}

		public function set displayName(value:String):void {
			displayName$field = value;
		}

		public function get displayName():String {
			return displayName$field;
		}

		public static const CCU:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.gigalaxy.game.protocol.zone.RoomGroupData.ccu", "ccu", (3 << 3) | com.netease.protobuf.WireType.VARINT);

		private var ccu$field:int;

		private var hasField$0:uint = 0;

		public function clearCcu():void {
			hasField$0 &= 0xfffffffe;
			ccu$field = new int();
		}

		public function get hasCcu():Boolean {
			return (hasField$0 & 0x1) != 0;
		}

		public function set ccu(value:int):void {
			hasField$0 |= 0x1;
			ccu$field = value;
		}

		public function get ccu():int {
			return ccu$field;
		}

		public static const MAXUSERS:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.gigalaxy.game.protocol.zone.RoomGroupData.maxUsers", "maxUsers", (4 << 3) | com.netease.protobuf.WireType.VARINT);

		private var maxUsers$field:int;

		public function clearMaxUsers():void {
			hasField$0 &= 0xfffffffd;
			maxUsers$field = new int();
		}

		public function get hasMaxUsers():Boolean {
			return (hasField$0 & 0x2) != 0;
		}

		public function set maxUsers(value:int):void {
			hasField$0 |= 0x2;
			maxUsers$field = value;
		}

		public function get maxUsers():int {
			return maxUsers$field;
		}

		public static const ALLOWEDAMOUNTS:RepeatedFieldDescriptor$TYPE_INT32 = new RepeatedFieldDescriptor$TYPE_INT32("com.gigalaxy.game.protocol.zone.RoomGroupData.allowedAmounts", "allowedAmounts", (5 << 3) | com.netease.protobuf.WireType.VARINT);

		[ArrayElementType("int")]
		public var allowedAmounts:Array = [];

		public static const ISBOTALLOWED:FieldDescriptor$TYPE_BOOL = new FieldDescriptor$TYPE_BOOL("com.gigalaxy.game.protocol.zone.RoomGroupData.isBotAllowed", "isBotAllowed", (6 << 3) | com.netease.protobuf.WireType.VARINT);

		private var isBotAllowed$field:Boolean;

		public function clearIsBotAllowed():void {
			hasField$0 &= 0xfffffffb;
			isBotAllowed$field = new Boolean();
		}

		public function get hasIsBotAllowed():Boolean {
			return (hasField$0 & 0x4) != 0;
		}

		public function set isBotAllowed(value:Boolean):void {
			hasField$0 |= 0x4;
			isBotAllowed$field = value;
		}

		public function get isBotAllowed():Boolean {
			return isBotAllowed$field;
		}

		/**
		 *  @private
		 */
		override public final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
			if (hasGroupId) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 1);
				com.netease.protobuf.WriteUtils.write$TYPE_STRING(output, groupId$field);
			}
			if (hasDisplayName) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 2);
				com.netease.protobuf.WriteUtils.write$TYPE_STRING(output, displayName$field);
			}
			if (hasCcu) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 3);
				com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, ccu$field);
			}
			if (hasMaxUsers) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 4);
				com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, maxUsers$field);
			}
			for (var allowedAmounts$index:uint = 0; allowedAmounts$index < this.allowedAmounts.length; ++allowedAmounts$index) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 5);
				com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.allowedAmounts[allowedAmounts$index]);
			}
			if (hasIsBotAllowed) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 6);
				com.netease.protobuf.WriteUtils.write$TYPE_BOOL(output, isBotAllowed$field);
			}
			for (var fieldKey:* in this) {
				super.writeUnknown(output, fieldKey);
			}
		}

		/**
		 *  @private
		 */
		override public final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
			var groupId$count:uint = 0;
			var displayName$count:uint = 0;
			var ccu$count:uint = 0;
			var maxUsers$count:uint = 0;
			var isBotAllowed$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
				switch (tag >> 3) {
				case 1:
					if (groupId$count != 0) {
						throw new flash.errors.IOError('Bad data format: RoomGroupData.groupId cannot be set twice.');
					}
					++groupId$count;
					this.groupId = com.netease.protobuf.ReadUtils.read$TYPE_STRING(input);
					break;
				case 2:
					if (displayName$count != 0) {
						throw new flash.errors.IOError('Bad data format: RoomGroupData.displayName cannot be set twice.');
					}
					++displayName$count;
					this.displayName = com.netease.protobuf.ReadUtils.read$TYPE_STRING(input);
					break;
				case 3:
					if (ccu$count != 0) {
						throw new flash.errors.IOError('Bad data format: RoomGroupData.ccu cannot be set twice.');
					}
					++ccu$count;
					this.ccu = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 4:
					if (maxUsers$count != 0) {
						throw new flash.errors.IOError('Bad data format: RoomGroupData.maxUsers cannot be set twice.');
					}
					++maxUsers$count;
					this.maxUsers = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 5:
					if ((tag & 7) == com.netease.protobuf.WireType.LENGTH_DELIMITED) {
						com.netease.protobuf.ReadUtils.readPackedRepeated(input, com.netease.protobuf.ReadUtils.read$TYPE_INT32, this.allowedAmounts);
						break;
					}
					this.allowedAmounts.push(com.netease.protobuf.ReadUtils.read$TYPE_INT32(input));
					break;
				case 6:
					if (isBotAllowed$count != 0) {
						throw new flash.errors.IOError('Bad data format: RoomGroupData.isBotAllowed cannot be set twice.');
					}
					++isBotAllowed$count;
					this.isBotAllowed = com.netease.protobuf.ReadUtils.read$TYPE_BOOL(input);
					break;
				default:
					super.readUnknown(input, tag);
					break;
				}
			}
		}

	}
}
